// 定义房子信息接口
interface House {
    id: number
    title: string
    address: Address
    houseType: string
    area: number
    price: number
    images: string[]
    keywords: string[]
    deposit: number // 押金
    create_time: string // 发布时间
    landlord: Landlord // 房东信息
    status: number // 状态：0-待审核，1-已租，2-空置，3-维修中，4-审核未通过，5-违规
}

// 定义地址接口
interface Address {
    city: string
    district: string 
    detailed_address: string
}

// 定义房东接口
interface Landlord {
    id: number
    username: string
    avatar: string
    age: number
    gender: number
    phone: string
    email: string
}

// 拼接地址
const formatAddress = (address: Address): string => {
    return `${address.city}市${address.district}区${address.detailed_address}`
}

export default formatAddress
// 导出
export { House, Address, Landlord }